package com.vxb.testmvp.util;

import android.content.Context;
import android.support.design.widget.Snackbar;
import android.view.View;
import android.widget.Toast;

/**
 * Created by User on 2017/3/3.
 */

public class Util {
    private Util() {}

    private static Toast toast;

    public static void showToast(Context context, String content) {
        if (toast == null) {
            toast = Toast.makeText(context, content, Toast.LENGTH_SHORT);
        } else {
            toast.setText(content);
        }
        toast.show();
    }

    public static void makeSnck(View view,String text){
        Snackbar.make(view, text,Snackbar.LENGTH_INDEFINITE)
                .setAction("重试", new View.OnClickListener(){
                    @Override
                    public void onClick(View v) {

                    }
                })
                .show();
    }


}
